 var cycles = [
        {
            "id": 10002,
            "name": "按周",
            "child": [
                {
                    "id": 100021,
                    "name": "星期一",
                },
                {
                    "id": 100022,
                    "name": "星期二"
                },
                {
                    "id": 100023,
                    "name": "星期三"
                },
                {
                    "id": 100024,
                    "name": "星期四"
                },
                {
                    "id": 100025,
                    "name": "星期五"
                }
            ]
        },
         {
            "id": 20001,
            "name": "按月",
            "child": [
                {
                    "id": 200011,
                    "name": "1"
                },
                {
                    "id": 200012,
                    "name": "2"
                }
                ,
                {
                    "id": 200013,
                    "name": "3"
                }
                ,
                {
                    "id": 200014,
                    "name": "4"
                }
                ,
                {
                    "id": 200015,
                    "name": "5"
                }
                ,
                {
                    "id": 200016,
                    "name": "6"
                }
                ,
                {
                    "id": 200017,
                    "name": "7"
                }
                ,
                {
                    "id": 200018,
                    "name": "8"
                }
                ,
                {
                    "id": 200019,
                    "name": "9"
                }
                ,
                {
                    "id": 200020,
                    "name": "10"
                }
                ,
                {
                    "id": 200021,
                    "name": "11"
                }
                ,
                {
                    "id": 200022,
                    "name": "12"
                }
                ,
                {
                    "id": 200023,
                    "name": "13"
                }
                ,
                {
                    "id": 200024,
                    "name": "14"
                }
                ,
                {
                    "id": 200025,
                    "name": "15"
                },
                {
                    "id": 200026,
                    "name": "16"
                },
                {
                    "id": 200027,
                    "name": "17"
                },
                {
                    "id": 200028,
                    "name": "18"
                },
                {
                    "id": 200029,
                    "name": "19"
                },
                {
                    "id": 200030,
                    "name": "20"
                },
                {
                    "id": 200031,
                    "name": "21"
                },
                {
                    "id": 200032,
                    "name": "22"
                },
                {
                    "id": 200033,
                    "name": "23"
                },
                {
                    "id": 200034,
                    "name": "24"
                },
                {
                    "id": 200035,
                    "name": "25"
                },
                {
                    "id": 200036,
                    "name": "26"
                },
                {
                    "id": 200037,
                    "name": "27"
                },
                {
                    "id": 200038,
                    "name": "28"
                },
		{
                    "id": 200038,
                    "name": "29"
                },
		{
                    "id": 200038,
                    "name": "30"
                }
            ]
        },
        {
            "id": 30003,
            "name": "按日",
            "child": [
                {
                    "id": 300031,
                    "name": "每日",
                }
            ]
        },
        {
            "id": 40004,
            "name": "最优方式",
            "child": [
                {
                    "id": 400041,
                    "name": "一键捕获最优方式",
                }
            ]
        }
    ]

 window.onload = function(){
    var c = document.querySelector("#cycle");
    var t = document.querySelector("#time");

    for (var i = 0; i < cycles.length; i ++){
        var curr = cycles[i];
        var opt = new Option(curr.name,  i);
        c.appendChild(opt)
    }

    c.onchange = function (){
        var index = this.value;
        var datas = cycles[index].child;
        t.innerHTML = "";
        for (var i = 0; i < datas.length; i ++){
            var curr = datas[i];
            var opt = new Option(curr.name, i);
            t.appendChild(opt)
        }
    }

    c.onchange();
 }
